package routing;

import geocoding.CustomNodes;

import java.util.ArrayList;

public class Landmarks2 {
	
	private ArrayList<Integer> landmarks = new ArrayList<Integer>();
	public String TAG = "URNav";
	
	public void getLandmarks (CustomNodes cn) {

		
		for (int nodes=0; nodes<cn.getSize(); nodes++){
			boolean titleSet=false;
			
			if (cn.getHas_tags(nodes)) {

				
				int currentRank=10;
				boolean excluded=false; 
				boolean hasname=false;
				boolean street=false; 
				
				for (int tags=0; tags<cn.getValueSize(nodes); tags++) {

					
					
					if (cn.getTag(nodes, tags).equals("historic")) {
						if (currentRank > 0) {
							currentRank=0; 
						}
		
					}
					
					if (cn.getTag(nodes, tags).equals("tourism")) {
						if (currentRank > 1) {
							currentRank=1; 
						}
					
					
					}
					
					if (cn.getTag(nodes, tags).equals("shop")) {
						if (currentRank > 2) {
							currentRank=2; 
						}
						
					
					}
					
					if (cn.getTag(nodes, tags).equals("building")) {
						if (currentRank > 3) {
							currentRank=3; 
						}
						
					
					}
					

					
					if (cn.getTag(nodes, tags).equals("name") && titleSet==false) {
						hasname=true;
						if (currentRank > 4) {
							currentRank=4; 
						}
						
					
					}
					
					if (cn.getTag(nodes, tags).equals("natural")) {
						
						if (currentRank > 5) {
							currentRank=5; 
						}
					
					}
					
					if ((cn.getTag(nodes, tags).equals("highway"))) {
						
						street=true;
					
					}
					
				}
				
				
				
				if ((currentRank==3) && hasname==false) {
					excluded=true;
				}
				
				if ((currentRank>3) && street==true) {
					excluded=true;
				}
				
				
				if ((excluded==false) && (currentRank<10)) {
				cn.setLmrank(nodes, currentRank);
				cn.setIs_uni_landmark(nodes, true); 

				}
			}
			
		}
		
		
	}

	public void setSurfaces (Trip myTrip) {
		
	}
	
}
